﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SubSonic;
using CXDB;

public partial class Search_view : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Request["id"]!=null)
        {

            Query q = new Query(CxApply.Schema);
            q.AddWhere("id", Request["id"]);
            q.SetSelectList("tbname");
            if(q.GetRecordCount()>0)
            {
                switch (q.ExecuteScalar().ToString())
                {
                    case "cx_staff_hr":
                        Response.Redirect("~/search/hr/view.aspx?id=" + Request["id"]);
                        break;
                    case "cx_provider":
                        Response.Redirect("~/search/provider/view.aspx?id=" + Request["id"]);
                        break;
                    case "cx_company_pingjia":
                        Response.Redirect("~/search/company/view.aspx?id="+Request["id"]);
                        break;
                    case "cx_staff_safty":
                        Response.Redirect("~/search/safty/view.aspx?id=" + Request["id"]);
                        break;
                    case "cx_chengxin":
                        Response.Redirect("~/search/scores/view.aspx?id=" + Request["id"]);
                        break;
                        default:
                        break;
                }
            }
        }
        
    }
}
